def f9():
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
def f16():
    music.play_tone(392, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(392, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(349, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(262, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(262, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.rest(music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
def f7():
    music.play_tone(220, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(349, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(392, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(392, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(392, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(392, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
def f12():
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(262, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(392, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
def f3():
    music.play_tone(220, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(349, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(247, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.rest(music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
def f6():
    music.play_tone(196, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(262, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(220, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.rest(music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(220, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
def f11():
    music.play_tone(349, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(349, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(349, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(349, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(349, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.QUARTER))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.QUARTER))
    music.rest(music.beat(BeatFraction.EIGHTH))
def f5():
    music.play_tone(196, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(262, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(196, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.rest(music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(196, music.beat(BeatFraction.QUARTER))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(196, music.beat(BeatFraction.QUARTER))
    music.rest(music.beat(BeatFraction.EIGHTH))
def f4():
    music.play_tone(392, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(392, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(349, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(262, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.rest(music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
def f10():
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(392, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(262, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.rest(music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
def f2():
    music.play_tone(196, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(262, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(220, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.rest(music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
def f1():
    music.play_tone(196, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(330, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(262, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(196, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.rest(music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(196, music.beat(BeatFraction.QUARTER))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(196, music.beat(BeatFraction.QUARTER))
    music.rest(music.beat(BeatFraction.EIGHTH))
def f8():
    music.play_tone(440, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(392, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(349, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(294, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(262, music.beat(BeatFraction.WHOLE))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.play_tone(262, music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))
    music.rest(music.beat(BeatFraction.HALF))
    music.rest(music.beat(BeatFraction.EIGHTH))

def on_forever():
    if input.button_is_pressed(Button.A):
        music.set_volume(43)
        music.set_tempo(138)
        f1()
        f2()
        f3()
        f4()
        f5()
        f6()
        f7()
        f8()
        f9()
        f10()
        f11()
        f12()
        f9()
        f10()
        f11()
        f16()
basic.forever(on_forever)
